var webpage = require('webpage').create();
var path ='c:/slimerjsout/';


webpage.onConsoleMessage= function(msg, lineNum, sourceId, level, func, timestamp) {
    var out = msg.split(' ');
    if(out[1]>=15){
        slimer.exit()
    }
    webpage.render(path+'/'+out[0]+'.png',
        {onlyViewport:true});
}
webpage
    .open('http://localhost:8080/qietu/test_pixel_slimerjs.html') // loads a page
    .then(function(){ // executed after loading
        // store a screenshot of the page
        webpage.viewportSize =
            { width:512, height:512 };
    });